home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / games / 243 / madmonk2 / read.me < prev   
Text File  |  1988-10-10  |  10KB  |  272 lines

  1. **************************************************
  2.     MADMONK - GEM Text Travesty Generator
  3.         (c) 1988 
  4.     Don E. Farmer
  5.     16810 Deer Creek Dr.
  6.     Spring, TX 77379
  7.  
  8.     This is SHAREWARE.  It is not to be sold.
  9.     A donation of $5.00 is requested, please.
  10. **************************************************
  11.  
  12.  
  13.                    GEM Text Travesty Generator
  14.   
  15.  
  16.      Have you ever felt mimsy?   Not sure?   Perhaps you could ask 
  17.   
  18. the  borogoves.   But then they may not answer because the  slithy 
  19.   
  20. toves did gyre and gimble in the wabe.   These nonsense words  are 
  21.   
  22. from   Lewis   Carroll's  poem  "Jabberwocky."    This   judicious 
  23.   
  24. juxtaposition  of letters is fun.   Maybe the author of  Alice  in 
  25.   
  26. Wonderland had a travesty generator!
  27.   
  28.      Generating travesties arose, perhaps, from a pronouncement by 
  29.   
  30. Sir  Arthur Eddington at Cambridge in 1927:        
  31.  
  32.  
  33.      "If  an  army of monkeys were strumming on  typewriters  they 
  34.   
  35.      might write all the books in the British Museum."
  36.  
  37.   
  38. William Ralph Bennett, Jr. gives an account of this in his chapter 
  39.   
  40. on Language in Scientific and Engineering Problem-Solving with the 
  41.   
  42. Computer,  Prentice  Hall  1976.   He  terms it  "monkeys  at  the 
  43.   
  44. typewriters."  I do not know who coined the term "travesty."
  45.   
  46.      MADMONK is a GEM based travesty generator.   I have tried  to 
  47.   
  48. make its use self-evident with a HELP menu.   I would like for you 
  49.   
  50. to try the program now.   You can come back to the following  text 
  51.   
  52. later.  I fear that once I use the term probability matrix some of 
  53.   
  54. you  will think the program too mathematical and never give  it  a 
  55.   
  56. chance.  For some fun you will need only a text file with which to 
  57.   
  58. make  a travesty.   
  59.  
  60.      Using Eddington's analogy, each of MADMONK'S typewriters have 
  61.   
  62. 27 keys,  the letters A though Z and the space key.   If all  keys 
  63.   
  64. are equally probable, the typed output is termed zero order.  This 
  65.   
  66. merely exercises the random number generator, the monkeys.  Higher 
  67.   
  68. order travesties require an input text.  
  69.  
  70.      A  first  order travesty is one in which the output  text  is 
  71.   
  72. correlated to the frequency of each letter in the input text.  The 
  73.   
  74. higher  order travesties are generalizations of the  first  order.  
  75.   
  76. So let's concentrate on the first order.   
  77.  
  78.      Suppose  the  input  text  is  one  of  Shakespeare's  plays.  
  79.   
  80. MADMONK  reserves 27 places in memory to store the count  of  each 
  81.   
  82. letter as it is read.   Allow me an analogy.   Imagine a road with 
  83.   
  84. 27  bridges.   The distances between the bridges  varies  greatly, 
  85.   
  86. analogous to the letter count.   The natives who live between  the 
  87.   
  88. bridges speak differing languages each of which consists of only a 
  89.   
  90. single letter.   (I guess the ones who "speak a space" say nothing 
  91.   
  92. at  all.)  Suppose you are at the start of this road and  plan  to 
  93.   
  94. drive  a certain distance to a friend's house.   Since you're  not 
  95.   
  96. sure just how far it is,  you stop and ask a fellow on the side of 
  97.   
  98. the road.   Now this fellow who happens to know your friend, alas, 
  99.   
  100. has  terrible  number sense.   In essence he gives  you  a  random 
  101.   
  102. number.   So  you drive this distance and instead of finding  your 
  103.   
  104. friend,  you  find  people who speak only  the  letter  'L',  say.  
  105.   
  106. Thinking  you've erred,  you go back to the start of the road  and 
  107.   
  108. ask the stranger again, get another random distance to travel, and 
  109.   
  110. come  up  with yet another letter.   If you were  to  continue  to 
  111.   
  112. retrieve  letters  in this manner,  they would spell out  what  is 
  113.   
  114. termed a first order Shakespearean travesty.
  115.   
  116.      Mathematically speaking,  these numbers,  the letter count or 
  117.   
  118. the  distances  between the bridges,  form a 1  x  27  correlation 
  119.   
  120. matrix.   One  dimensional matrices are called vectors,  and  when 
  121.   
  122. there  is  nothing to correlate with,  the components  are  called 
  123.   
  124. frequencies.
  125.   
  126.      A  second order travesty is one in which the output  text  is 
  127.   
  128. correlated to the frequency of letter pairs in the input text.  In 
  129.   
  130. other words,  MADMONK counts the number of AA's, AB's, ... , ZZ's, 
  131.   
  132. ...  ,  <space><space>'s  in the input text.   This results  in  a 
  133.   
  134. correlation matrix,  one with 27 rows and 27 columns.   The matrix 
  135.   
  136. requires 2,916 bytes.   That is (2*27)*(2*27),  each element being 
  137.   
  138. an unsigned 16 bit integer.   Using a hard disk it takes about  12 
  139.   
  140. seconds to do a travesty on 3K input file.   All output travesties 
  141.   
  142. consist of 10,000 characters.   If more is needed,  MADMONK can be 
  143.   
  144. run again and the output files merged with a text editor.
  145.   
  146.      A  third  order travesty is one in which the output  text  is 
  147.   
  148. correlated to the frequency of letter triplets in the input text.
  149.   
  150. The  probability matrix is 27 x 27 x 27,  which  requires  157,464 
  151.   
  152. bytes.  About 50 seconds are required to do a 3K input file.
  153.  
  154.      A  fourth order travesty is one in which the output  text  is 
  155.   
  156. correlated  to  the frequency of letter quadruplets in  the  input 
  157.   
  158. text.   "THE<space>" and "<space>AND" are common quadruplets.  The 
  159.   
  160. matrix is 27 x 27 x 27 x 27.   But (2*27) raised to the 4th  power 
  161.   
  162. is 8,503,056.  Eight megabytes exceed the memory of most machines.  
  163.   
  164. It is possible, of course, to use the hard disk as storage.  There 
  165.   
  166. is, however, a speed penalty to pay.  I chose another alternative.  
  167.   
  168. At  this  point I changed the element size of the matrix  from  16 
  169.   
  170. bits to 8 bits.   Since 27 raised to the 4th power is  531,441,  a 
  171.   
  172. one megabyte machine can store the matrix.   However,  with only 8 
  173.   
  174. bits  the size of the input text is limited.   If there  are  more 
  175.   
  176. than 255 "the's" or "and's", for example, in the input text, the 8 
  177.   
  178. bit matrix elements will overflow.   MADMONK will warn you if this 
  179.   
  180. happens.  It takes about 3 minutes to do a 3K input file.
  181.   
  182.      A  fifth  order travesty is one in which the output  text  is 
  183.   
  184. correlated to the frequency of letter quintets in the input  text.  
  185.   
  186. Raising 27 to the 5th power yields 14,348,907.   So a 16  megabyte 
  187.   
  188. partition on the hard disk drive could hold the matrix.   There is 
  189.   
  190. another  alternative.   A fifth order matrix can  be  approximated 
  191.   
  192. with two fourth order ones.   In years past I have approximated  a 
  193.   
  194. third  order matrix with two second order ones.   This was when  I 
  195.   
  196. worked  with a computer that had only 4K of main memory  and  tape 
  197.   
  198. drives.  I must not have been too pleased with the results because 
  199.   
  200. I no longer have my notes.   For now I can only say that the fifth 
  201.   
  202. order travesty is in my in basket.
  203.   
  204.      The mathematical details of how these matrices are built from 
  205.   
  206. the input text and how the output text is constrained to match the 
  207.   
  208. probability  spectrum  are  open  to view in  the  C  source  code 
  209.   
  210. listing.   Scoping  precludes further elucidation on either the  C 
  211.   
  212. language or probability theory.   (Cryptic, enough?)  I do hope my 
  213.   
  214. analogy   of   the  first  order  was  helpful   to   those   less 
  215.   
  216. mathematically inclined.
  217.   
  218.      It  is  time to end the discussion on how MADMONK  works  and 
  219.   
  220. move on to hint at what feeling mimsy is all about.   Or to put it 
  221.   
  222. another way, what do you do with a travesty anyway?
  223.   
  224.      How intelligible a travesty is, as you have seen from running 
  225.   
  226. MADMONK, depends on the order.  It also depends on the input text.  
  227.   
  228. Travesties  on  different  authors  yield  different   correlation 
  229.   
  230. matrices.   Identifying  unknown  or  disputed  authors  with  the 
  231.   
  232. computer entails doing certain statistics on these matrices.  With 
  233.   
  234. some authors you get words, with others you get complete sentences 
  235.   
  236. that  might interest the borogoves.   Shakespeare  travesties  are 
  237.   
  238. vulgar.  The thought has crossed my mind to send one off to a smut 
  239.   
  240. peddler.   Just a fleeting thought!   Yet in a travesty of  Surely 
  241.   
  242. You're Joking Mr.  Feynman! profanity is rare.  On the surface the 
  243.   
  244. styles  of  the two authors do not seem to differ  that  much.   I 
  245.   
  246. choose to leave the word "style" undefined.   (Technically,  there 
  247.   
  248. is a homeomorphism between thermodynamics and information  theory.  
  249.   
  250. This  means that you can talk about letter entropy.)  As  a  final 
  251.   
  252. hint, MADMONK can lead you to a land, where I hope you don't think 
  253.   
  254. this article has already led you, Cryptogamica.  Seriously though, 
  255.   
  256. the  monkeys  don't care whether its English  or  Russian  they're 
  257.   
  258. typing.  (I can't tell you more because it's TOP SECRET.)
  259.  
  260.  
  261. *******************************************************************
  262. The text above was written some time ago.  There is a serious side
  263. to all of this, and it has to do with entropy and language.  I am
  264. interested in travesties because I have been exploring how much
  265. randomness there is in creativity for many years now.  I think there
  266. is a lot.
  267. MADMONK V1.3 PD, as presently stands, is robust.  I am now looking
  268. at the generation of morphenes, i.e., "pieces" of words that are more
  269. than letters yet not quite words but of which words are made out of.
  270. There are many more of these than letters, but you also get a more
  271. "meaningful" travesty too.  Well, have fun with this.
  272.